/*
 * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef SLE_ANNOUNCE_HAL_H
#define SLE_ANNOUNCE_HAL_H

#ifndef SLE_LOG_TAG
#define SLE_LOG_TAG "[SleHal]"
#endif

#include <stdint.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include "sle_announce_hdi.h"
#include "sle_announce_config.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @brief SleHalStartAnnounceCallback
 * @param [in] announceId
 * @param [in] errCode
 * 
 * @return None
 */
typedef void (*SleHalStartAnnounceCallback)(uint8_t announceId, SleHalErrorCode errCode);

/**
 * @brief SleHalStopAnnounceCallback
 * @param [in] announceId
 * @param [in] errCode
 * 
 * @return None
 */
typedef void (*SleHalStopAnnounceCallback)(uint8_t announceId, SleHalErrorCode errCode);

/**
 * @brief SleHalTerminalAnnounceCallbcak
 * @param [in] announceId
 * 
 * @return None
 */
typedef void (*SleHalTerminalAnnounceCallbcak)(uint8_t announceId);

/**
 * @brief SleHalRemoveAnnounceCallbcak
 * @param [in] announceId
 * @param [in] errCode
 * 
 * @return None
 */
typedef void (*SleHalRemoveAnnounceCallbcak)(uint8_t announceId, SleHalErrorCode errCode);
typedef struct {
    SleHalStartAnnounceCallback OnAnnounceHalStartAnnounceCb;
    SleHalStopAnnounceCallback OnAnnounceHalStopAnnounceCb;
    SleHalTerminalAnnounceCallbcak OnAnnounceHalTerminalAnnounceCb;
    SleHalRemoveAnnounceCallbcak OnAnnounceHalRemoveAnnounceCb;
} SleAnnounceHalCallbacks;

/**
 * @brief InitSleAnnounceHal
 * 
 * @param None
 * @return SleHalErrorCode
 */
SleHalErrorCode InitSleAnnounceHal(void);

/**
 * @brief DeinitSleAnnounceHal
 * 
 * @param None
 * @return SleHalErrorCode
 */
SleHalErrorCode DeinitSleAnnounceHal(void);

/**
 * @brief SleAnnounceHalSetAnnounceData
 * 
 * @param [in] announceId
 * @param [in] data
 * @return SleHalErrorCode
 */
SleHalErrorCode SleAnnounceHalSetAnnounceData(uint8_t announceId, const SleAnnounceData *data);

/**
 * @brief SleAnnounceHalSetAnnounceParam
 * 
 * @param [in] announceId
 * @param [in] param
 * @return SleHalErrorCode
 */
SleHalErrorCode SleAnnounceHalSetAnnounceParam(uint8_t announceId, const SleAnnounceParam *announcHalParam);

/**
 * @brief SleAnnounceHalStartAnnounce
 * 
 * @param [in] announceId
 * @return SleHalErrorCode
 */
SleHalErrorCode SleAnnounceHalStartAnnounce(uint8_t announceId);

/**
 * @brief SleAnnounceHalStopAnnounce
 * 
 * @param [in] announceId
 * @return SleHalErrorCode
 */
SleHalErrorCode SleAnnounceHalStopAnnounce(uint8_t announceId);

/**
 * @brief SleAnnounceHalTerminalAnnounce
 * 
 * @param [in] callback
 * @return SleHalErrorCode
 */
SleHalErrorCode SleAnnounceHalRegisterCallbacks(const SleAnnounceHalCallbacks *callback);

#ifdef __cplusplus
}
#endif

#endif // SLE_ANNOUNCE_HAL_H